Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SEQURE S99, and new Rev. of S60P #1920

Open
wants to merge 39 commits into
base: dev
Choose a base branch
from

Conversation

jonasius
Copy link

@jonasius jonasius commented May 26, 2024

  • Please check if the PR fulfills these requirements
  • The changes have been tested locally
  • There are no breaking changes
  • What kind of change does this PR introduce?
  • Add support for Sequre S99
  • What is the new behavior (if this is a feature change)?
    IronOS booting on Sequre S99

  • Other information:
    Currently work in progress.

Problems / Todo

  • Startup is slow, black screen for a few seconds, maybe due to PD negotiation issues?
  • Negotiation of PD seems to have a problem. Tested with multiple Apple USB-C Chargers.Always uses 5V QC. PD Debug at startup shows State 0 0 21 multiple times, with blinking/resetting screen, after a while showing State 4 1 21.
  • OP_AMP_GAIN_STAGE 536 needs to be adjusted according to the 22k resistor instead of 51k
  • Documentation needs to be updated
  • Maybe source/Code/BSP/Sequre_S60 folder should be renamed to Sequre?
  • Better thermo model for tip temperature measurement?
  • Tip selection option to allow usage of 5.5 Ohm tips?

source/Core/BSP/Sequre_S60/configuration.h Outdated Show resolved Hide resolved
source/Core/Drivers/Font.h Outdated Show resolved Hide resolved
@Ralim
Copy link
Owner

Ralim commented Jun 1, 2024

Hia,

This is great progress.

The black screen at startup is odd. PD negotiation shouldn't block boot. Is it possible its being restarted rapidly with flaky USB-PD?

(Do you have any tools for debugging USB-PD)?

I haven't really worked on the FS2711 driver much so not sure how best to debug it other than trying to parse the code to match up to what you see.

@jonasius
Copy link
Author

jonasius commented Jun 1, 2024

Hey, yeah. It seems to restart rapidly. It seems to be especially with the Apple Chargers. Another charger I tried let the iron boot straight up.
I hope I can investigate further this weekend.

Sadly I don't have special USB-PD tools. Maybe I need to get something or build something to hook a logic analyzer on?

As I could see with the debug menu, when it comes up it gets all available PD modes, but stays in 5V mode. I think I need to take a look at the measurement of the tip for the power calculation? Maybe you can give me a hint on that?

@jonasius
Copy link
Author

jonasius commented Jun 1, 2024

@Ralim I'm currently digging a bit through the code and debug outputs of the iron. I wondered why it reports PWR QC instead of PWR PD. I think at least I need to extend the getPowerSourceNumber funciton with a ifdef for POW_PD_EXT.

Regarding the PD negotation problem with my Apple 60W USB-C PSUs I tried to increase the PROTOCOL_TIMEOUT to 200 ms, which helped. The Iron boots instantly. PD Debug First Shows State 0 0 21 but quickly changes to State 4 1 21, without a reset/screen flicker. What I noticed when I switched through the PD debug menu and viewed the capabilities was that before increasing the timeout, the PD debug menu showed an entry with no voltage and only amps specified. That entry isn't showing up with the increased timeout.

I hope I can make some progress tomorrow.

@Ralim
Copy link
Owner

Ralim commented Jun 2, 2024

I'm currently digging a bit through the code and debug outputs of the iron. I wondered why it reports PWR QC instead of PWR PD. I think at least I need to extend the getPowerSourceNumber funciton with a ifdef for POW_PD_EXT.

Ah heck, yes that will fix the issue

PROTOCOL_TIMEOUT should have been wired up to the PD timeout we already have thats user adjustable.
If you want I can wire that up (or you can of course). I default to 500ms for normal pd.

@jonasius
Copy link
Author

jonasius commented Jun 2, 2024

PROTOCOL_TIMEOUT should have been wired up to the PD timeout we already have thats user adjustable. If you want I can wire that up (or you can of course). I default to 500ms for normal pd.

@Ralim It's a bit unclear to me. In the Settings.cpp PDNegTimeout default value is 20, max 50. If I got the description right it should be in 100ms steps, so default is 2000ms? :-o

OP_AMP_GAIN_STAGE 536 needs to be adjusted according to the 22k resistor instead of 51k

How did you determined the value for the OP_AMP_GAIN_STAGE? I measured/calculated it roughly to 226 for the different feedback resistor. I don't get exactly how the two OP-Amps are connected.

@Ralim
Copy link
Owner

Ralim commented Jun 4, 2024

so default is 2000ms? :-o

Ah sorry, I think we raised the default later on.

How did you determined the value for the OP_AMP_GAIN_STAGE
This number is calculated as being the "gain" of the op-amp.

In the S60, its two sequential op-amps chained.
Both are configured as non-inverting amplifiers.

Input op-amp has feedback resistors of 9.31K and 1K. (therefore gain is 10.31)
Second op-amp has feedback resistors of 51K and 1K. (therefore gain is 52).

So 10.31 * 50 = 536.12; so the define is set to 536

* Enable PD Options
* Make PDNegTimeout configureable
* Add default value for PDNegTimeout, also for S60 and S60P
* Add basic DC detection / correct debug readings while powered via DC
* Add basic ThermoModel for C245 Tips
* Modify op-amp gain
bool getIsPoweredByDCIN() { return false; }
bool getIsPoweredByDCIN() {
#if POW_PD_EXT == 2 && defined(POW_DC)
if (!FS2711::has_run_selection()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Copy link
Owner

@Ralim Ralim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems sane to me at a read.

@Ralim
Copy link
Owner

Ralim commented Jun 8, 2024

Let me know when you are happy with this by marking it ready for review 🙇🏼

@jonasius
Copy link
Author

Let me know when you are happy with this by marking it ready for review 🙇🏼

Nice!
I'll try to fine tune the temperature coefficient beforehand. Add documentation / the S90 to the supported irons table and fix the remaining clang style mismatches.

@jonasius
Copy link
Author

jonasius commented Jun 19, 2024

I compared the temperature at a setpoint of 320°C to a original JBC station. In my eyes the coefficient is okay for a first shot.

Then I observed that the name and description for PDNegTimeout and USBPDMode are not shown in the menu. I quite don't get it. The menu Item is here

I got a second S99 which is V1.5 instead of V1.4, it seems that they changed something. Although a FS2711 is used, it does not negotiate PD. I quickly took two picutes:
IMG_4353
IMG_4354

@jonasius
Copy link
Author

@Ralim, I tried your increased pwm speed. Works great on the S99! No more restarts, even with power limit set to 60W on a 60W USB-C charger.

What I got so far regarding v1.5

  • There is a detection of HW version in the original FW
  • I2C to the FS2711Q connection seems to use the same pins
  • Just to make sure I checked the bootloader, it is also the same on the v1.5 iron
  • PD-Debug shows only zeros

@Ralim
Copy link
Owner

Ralim commented Jul 28, 2024

The No-PD IC detected warning is only shown 3 times fwiw, so if looking into that you will have to do a settings reset under the advanced settings to get it to show up again.
If thats showing up but pd is "working" then its likely just the probe timing out somehow at first boot-check

@jonasius
Copy link
Author

jonasius commented Aug 8, 2024

@discip if you want you can test the following build and see if the PD ic communication is working with your S60P.
https://github.com/jonasius/IronOS/actions/runs/10289925091

@pineapple-academic
Copy link

As a new user of IronOS, I want to thank you for your passionate work. I just flashed the build from jonasius/IronOS/actions/runs/10289925091 on my new S99, and the first issue I encountered was when I flipped the display orientation to left-handed. The idle screen seems to be experiencing some graphical issues.
s99_lh_issue

@discip
Copy link
Collaborator

discip commented Aug 8, 2024

@jonasius
First of all, thanks for still working on it. 👍

Unfortunately, the result is still pretty similar:

PD Debug
Status 0

@discip
Copy link
Collaborator

discip commented Aug 8, 2024

@pineapple-academic
Please open a new issue as the one you described above is not related to this PR.

@Ralim
Confirming this issue!

@thetooth
Copy link

thetooth commented Aug 9, 2024

Just a heads up, the work done here seems to have fixed my OG v1.0 S60P, which uses the same PD IC as v1.5 S99 and identical board and other components to the v1.4 S99.

Takes about 600ms to reach target temperature now lmao.

@jonasius
Copy link
Author

@discip
Could you check if the "No USB-PD IC detected!" message is shown with the latest build of this PR after flashing, remember it is just shown 3 times.

Just a few quick notes.

  • Current implementation probes on I2C bus 2, and if PD IC is present it will set bus 2. Otherwise sets bus 1 for PD IC.
  • Later in the code there is a second I2C probe on the previously set bus, this information is used for showing the "No USB-PD IC detected!" message.

For testing purposes I reversed the detection. Probing on bus 1, if present setting bus 1, otherwise setting bus 2. Interestingly with this procedure negotiation fails on both of my S99 (one with USB-PD IC on bus 1 and the other with USB-PD IC on bus 2). But only one iron is showing the "No USB-PD IC detected!".

Based on that I will investigate further within the next days.

@discip
Copy link
Collaborator

discip commented Aug 19, 2024

@jonasius
Sorry, I somehow forgot to comply with your request. 😔
The answer is:
No, the message NO-PD is not displayed even after a reset.

@teuchezh
Copy link

is there any progress?

@jonasius
Copy link
Author

Sorry, had little time lately. But it's getting colder, I think I'll be able to make some progress soon.

@paulfertser
Copy link
Contributor

FWIW, b036da9 (the latest version here) seems to be working fine on S99 V1.4 with an Honor (Huawei) 65 W Type-C adapter. Many thanks to everybody involved!

Does anybody want me to do any specific testing here? Somehow this thread doesn't have much feedback from happy owners already, how come?

BTW, I do not remember if it was mentioned already so want to highlight this service notice from the manufacturer just in case: PCB versions 1.3 and 1.4 require modification for long-term reliability: https://sequremall.com/blogs/sequre-product-firmware-upgrade/s99-soldering-iron-firmware-upgrade (scroll to "Recommend buyers add capacitance to the PCB of the S99 by themselves:").

@DurvalMenezes
Copy link

FWIW, b036da9 (the latest version here) seems to be working fine on S99 V1.4 with an Honor (Huawei) 65 W Type-C adapter

How can a binary for this version be downloaded? Or have you compiled it yourself?

service notice from the manufacturer just in case: PCB versions 1.3 and 1.4 require modification for long-term reliability

Is the PCB version the same shown as "H: " under the "About" option with the factory software?

@paulfertser
Copy link
Contributor

S99_EN.hex.gz

@paulfertser
Copy link
Contributor

paulfertser commented Sep 28, 2024 via email

@jonasius
Copy link
Author

How can a binary for this version be downloaded? Or have you compiled it yourself?

See here:
https://github.com/jonasius/IronOS/actions/runs/10709046785/job/29692775793

Is the PCB version the same shown as "H: " under the "About" option with the factory software?

From my observation it should be the pcb/hw revision.

@thetooth
Copy link

Thanks for your work on this. Everything is working great on my end with latest changes, full 60W out of a 60W lenovo adaptor at 19VDC.

@discip
Copy link
Collaborator

discip commented Nov 7, 2024

Unfortunately this is still not working for the S60P.
PD Debug State is still 0.

@Ralim
Any idea? 😃

@kabel42
Copy link

kabel42 commented Nov 8, 2024

Works on my (v1.1 PCB) S60P with a steamdeck charger and a lenovo 65W charger

@Ralim
Copy link
Owner

Ralim commented Nov 14, 2024

@discip What charger are you using? Ill try this locally

@discip
Copy link
Collaborator

discip commented Nov 14, 2024

@Ralim
This one:
Anker Nano II 65W. 😊

@g5pw
Copy link

g5pw commented Nov 15, 2024

https://github.com/jonasius/IronOS/actions/runs/10709046785/job/29692775793 Works on my new S99 (PCB v1.5) with a 65W charger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.